//
//  detailedSchoolView.m
//  QingTengGaoXiao
//
//  Created by 沈煜航 on 2018/10/6.
//  Copyright © 2018年 QingTeng. All rights reserved.
//

#import "detailedSchoolView.h"

@implementation detailedSchoolView

#pragma 重写init

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if(self){
        self = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] objectAtIndex:0];
        [self initBeforeAll];
    }
    return self;
}

#pragma 初始化方法

-(void)initBeforeAll{
    
}

#pragma public方法

-(void)changeTitle{
    UIView* rootView = self.superview.superview;
    for(UIView* view in rootView.subviews){
        if(view.tag == 123){
            rootView = view;
            break;
        }
    }
    for(UIView* view in rootView.subviews){
        if(view.tag == 123){
            UILabel* titleLabel = (UILabel*) view;
            [titleLabel setText:@"学校名称"];
            break;
        }
    }
    //显示starButton
    for(UIView* view in rootView.subviews){
        if(view.tag == 111){
            UIButton* starButton = (UIButton*) view;
            starButton.hidden = NO;
            starButton.enabled = YES;
            //枚举收藏夹plist，判断当前number是否被收藏
            BOOL isInPlist = NO;
            
            
            if(isInPlist){
                starButton.selected = YES;
            }
            break;
        }
    }
}

#pragma 按钮的action

@end
